home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / wais / waisgate / futil.h < prev    next >
C/C++ Source or Header  |  1995-05-09  |  3KB  |  86 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.  
  4.   
  5.   $Header: /y/src/wais/wais-8-b5/ir/RCS/futil.h,v 1.1.1.1 1992/07/11 00:59:42 curtisg Exp curtisg $
  6.  
  7.   $Log: futil.h,v $
  8.  * Revision 1.1.1.1  1992/07/11  00:59:42  curtisg
  9.  * Changes for SCO UNIX
  10.  *
  11. */
  12.  
  13. #ifndef FUTIL_H
  14. #define FUTIL_H
  15.  
  16. #include "cdialect.h"
  17. #include "cutil.h"
  18.  
  19. #ifdef M_UNIX
  20. #include <unistd.h>
  21. #define MAX_PATH_NAME_LEN 1023
  22. #endif
  23.  
  24. #define MAX_FILE_NAME_LEN 255
  25.  
  26. #define FType long
  27.  
  28. /* the following defines should be in stdio.h, but the
  29.    gnu C compiler doesn't define them for some reason
  30.  */
  31. #ifndef SEEK_SET 
  32. #define SEEK_SET 0  /* ANSI added by brewster */
  33. #define SEEK_CUR 1  /* ANSI added by brewster */
  34. #define SEEK_END 2  /* ANSI added by brewster */
  35. #endif
  36.  
  37. /* enhanced standard functions - don't call them directly, use the
  38.    macros below */
  39. FILE*    fs_fopen _AP((char* fileName,char* mode));
  40. long    fs_fclose _AP((FILE* file));
  41. long     fs_fseek _AP((FILE* file,long offset,long wherefrom));
  42. long     fs_ftell _AP((FILE* file));
  43.  
  44. #ifdef __cplusplus
  45. /* declare these as C style functions */
  46. extern "C"
  47.     {
  48. #endif /* def __cplusplus */
  49.  
  50. /* macros for standard functions.  call these in your program.  */
  51. #define s_fopen(name,mode)    fs_fopen((name),(mode))
  52. #define s_fclose(file)        { fs_fclose((FILE*)file); file = NULL; }
  53. #define s_fseek(file,offset,wherefrom) fs_fseek(file,offset,wherefrom)
  54. #define s_ftell(file)    fs_ftell(file)
  55.  
  56. void grow_file _AP((FILE* file,long length));
  57. long read_bytes _AP((long n_bytes,FILE *stream));
  58. long write_bytes _AP((long value, long n_bytes, FILE* stream));
  59. long read_bytes_from_memory _AP((long n_bytes, unsigned char* block));
  60.  
  61. time_t file_write_date _AP((char* filename)); /* os dependent */
  62. char *truename _AP((char *filename, char *full_path));
  63. long file_length _AP((FILE* stream));
  64. char *pathname_name _AP((char *pathname));
  65. char *pathname_directory _AP((char *pathname, char *destination));
  66. char *current_user_name _AP((void));
  67. boolean probe_file _AP((char *filename));
  68. boolean probe_file_possibly_compressed _AP((char *filename));
  69. boolean touch_file _AP((char *filename));
  70. char *merge_pathnames _AP((char *pathname, char *directory));
  71.  
  72. #ifdef THINK_C
  73. void setFileType _AP((char* fileName,FType type,FType creator));
  74. #endif /* def THINK_C */
  75.  
  76. boolean read_string_from_file _AP((FILE* stream,char* array,
  77.                    long array_length));
  78.  
  79. long count_lines _AP((FILE *stream));
  80.  
  81. #ifdef __cplusplus
  82.     }
  83. #endif /* def __cplusplus */
  84.  
  85. #endif /* FUTIL_H */
  86.